//
//  FirstViewController.m
//  Project
//
//  Created by jiangs on 16/1/22.
//  Copyright © 2016年 mehekeji. All rights reserved.
//

#import "FirstViewController.h"
#import "OneTableViewCell.h"
#import "TwoTableViewCell.h"
#import "ThreeTableViewCell.h"

@interface FirstViewController ()

@end

@implementation FirstViewController

- (void)viewDidLoad {
    [super viewDidLoad];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
}

#pragma -mark TableView
-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{

    return 3;
}

-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return 5;
}

-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    
    NSArray * arrText1 = @[@"星期一",@"星期二",@"星期三",@"星期四",@"星期五"];
    NSArray * imgname1 =@[@"星期一",@"星期二",@"星期三",@"星期四",@"星期五"];
    
    if (indexPath.section ==0) {
        NSString * CellIdentifier = @"OneTableViewCell";
        OneTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
            if(cell == nil){
                cell = [[[NSBundle mainBundle] loadNibNamed:@"OneTableViewCell" owner:self options:nil] lastObject];
            }
        cell.Label.text = arrText1  [indexPath.row];
        cell.Image.image = [UIImage imageNamed:imgname1[indexPath.row]];
        return cell;
        
    }else if(indexPath.section ==1){
        NSString *CellIdentifer = @"TwoTableViewCell";
        
        TwoTableViewCell *cell2 = [tableView dequeueReusableCellWithIdentifier:CellIdentifer];
        
        return cell2;
    }
        NSString *CellIdentifer = @"ThreeTableViewCell";
        
        ThreeTableViewCell *cell3 = [tableView dequeueReusableCellWithIdentifier:CellIdentifer];
        
        return cell3;

}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    return 100;
}
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
        return 20;
}

@end
